package com.gujiangbo.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

import java.util.concurrent.ConcurrentHashMap;

@Component
public class SystemConfig implements InitializingBean {

    private final ConcurrentHashMap<String, String> hashMap = new ConcurrentHashMap<>();

    public String getConfigByKey(String key) {
        return hashMap.get(key);
    }

    @Override
    public void afterPropertiesSet() {
        hashMap.put("redisIP", "127.0.0.1");
        hashMap.put("redisPort", "6379");
    }
}
